package com.ticket.system.domain.enu;

import lombok.Getter;

/**
 * @ClassName : TicketStatusEnum
 * @Description :
 * @Author : lixiang
 * @Date: 2024/1/4  11:06
 */
@Getter
public enum PointsEnum {
    ONE(1,"注册新用户"),
    TWO(2,"演出购票"),
    THREE(3,"演出评价"),
    FOUR(4,"实名认证"),
    FIVE(5,"充值"),
    SIX(6,"完善个人信息"),
    SEVEN(7,"演出分享"),
    EIGHT(8,"添加常用观演人");

    private final int code;

    private final String value;

    PointsEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static PointsEnum indexOf(Integer code) {
        for (PointsEnum obj : PointsEnum.values()) {
            if (code.equals(obj.getCode())) {
                return obj;
            }
        }
        return null;
    }

    public static PointsEnum indexOfMsg(String msg) {
        for (PointsEnum obj : PointsEnum.values()) {
            if (msg.equals(obj.getValue())) {
                return obj;
            }
        }
        return null;
    }
}
